window.onload = function() {
  var lis = document.getElementById("tab-bar").children;
  var items = document.getElementById("desc").children;

  for (var i = 0; i < lis.length; i++) {
    (function(num) {
      lis[i].onclick = function() {
        for (var j = 0; j < lis.length; j++) {
          lis[j].className = "";
          items[j].className = "desc-item hide";
        }
        this.className = "active";
        items[num].className = "desc-item";
      };
    })(i);
  }
};
